-- GENERATED SPELL FOR [Ethereal Priest] --


function spell0_18317(pUnit, Event) --@Heal,Heal--
pUnit:FullCastSpellOnTarget(22883,pUnit)
pUnit:RegisterEvent('Sorts_18317', 3500, 1)
end

function spell1_18317(pUnit, Event) --@Heal,Heal--
pUnit:FullCastSpellOnTarget(34945,pUnit)
pUnit:RegisterEvent('Sorts_18317', 3500, 1)
end

function spell2_18317(pUnit, Event) --@Holy Nova,Self--
pUnit:FullCastSpellOnTarget(34944,pUnit)
pUnit:RegisterEvent('Sorts_18317', 660, 1)
end

function spell3_18317(pUnit, Event) --@Holy Nova,Self--
pUnit:FullCastSpellOnTarget(37669,pUnit)
pUnit:RegisterEvent('Sorts_18317', 635, 1)
end

function spell4_18317(pUnit, Event) --@Power Word: Shield,n/a--
pUnit:FullCastSpellOnTarget(17139,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18317', 30296, 1)
end

function spell5_18317(pUnit, Event) --@Power Word: Shield,n/a--
pUnit:FullCastSpellOnTarget(35944,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18317', 30334, 1)
end

function Sorts_18317(pUnit, Event)
local choix_sorts_18317 = math.random(0, 5)
if choix_sorts_18317 == 0 then
pUnit:RegisterEvent('spell0_18317', 1, 1)
end
if choix_sorts_18317 == 1 then
pUnit:RegisterEvent('spell1_18317', 1, 1)
end
if choix_sorts_18317 == 2 then
pUnit:RegisterEvent('spell2_18317', 1, 1)
end
if choix_sorts_18317 == 3 then
pUnit:RegisterEvent('spell3_18317', 1, 1)
end
if choix_sorts_18317 == 4 then
pUnit:RegisterEvent('spell4_18317', 1, 1)
end
if choix_sorts_18317 == 5 then
pUnit:RegisterEvent('spell5_18317', 1, 1)
end
end

function mob18317_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18317', math.random(1500, 3000), 1)
end

function mob18317_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18317_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18317_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18317, 1, 'mob18317_Action')
RegisterUnitEvent(18317, 2, 'mob18317_Leave')
RegisterUnitEvent(18317, 3, 'mob18317_Kill')
RegisterUnitEvent(18317, 4, 'mob18317_Die')
